/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sg.edu.nus.iss.vmcs.store;

public class CoinValueIterator implements IStoreItemIterator{    
    
    private int currentPosition = 0;
    private CashStore cashStore;    
   
    
    public CoinValueIterator(CashStore cashStore){
       this.cashStore = cashStore;
    }  
    
    public void first() {
           currentPosition = 0;
       }
       
       public void next() {
           if (currentPosition < (cashStore.size)) {
               ++currentPosition;
           }
       }
       
       public boolean isDone() {
           if (currentPosition >= (cashStore.size)) {
               return true;
           } else {
               return false;
           }
       }
       
       public StoreItem currentItem() {
           return (CashStoreItem)cashStore.items[currentPosition];
       }
}
